﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Delphi.Mimir.Data.Entities.Final {
    public class Portfolio {
        public Portfolio() {
            Accounts = new List<Account>();
        }
        public int PortfolioId { set; get; }
        public int ClientId { set; get; }
        public Client Client { set; get; }
        public ICollection<Account> Accounts { set; get; }
        public string Name { set; get; }
        public Decimal Balance {
            get {
                return Accounts.Sum(a => a.Balance);
            }
        }
        public int CurrencyId { set; get; }
        public Currency Currency { set; get; }
    }
}
